<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <title>Document</title>
        <style>
            * {
                margin: 0;
                padding: 0;
                box-sizing: border-box;
                cursor: none;
            }
            .mouse {
                width: 50px;
                height: 50px;
                border-radius: 50%;
                position: fixed;
                left: -200px;
                z-index: 1000;
                pointer-events: none;
            }
        </style>
    </head>
    <body>
        <img class="mouse" src="logo.jpg" alt="" />

        <script>
            var mouse = document.querySelector('.mouse');
            window.addEventListener('mousemove', function (event) {
                mouse.style.left = event.clientX - mouse.offsetWidth / 2 + 'px';
                mouse.style.top = event.clientY - mouse.offsetHeight / 2 + 'px';
            });
            /* 
            核心就是获取鼠标在网页中的位置值，并赋值给鼠标光标，再通过绝对定位设置位置即可。
            mouse.offsetWidth/2 别忘了减去自身宽（高）的一半。 
            */
        </script>
    </body>
</html>
